<h2>LISTADO</h2>
<table id="tabla">
    <thead>
        <tr>
            <th style="width: 20%">Nombre</th>
            <th style="width: 10%">¿Está explotando el predio?</th>
            <th style="width: 50%">Observación</th>
            <th style="width: 20%">Opciones</th>
        </tr>
    </thead>
    <tbody>
        <?php
        App::Import('Model', 'Candidate');
        $con = new Candidate();
        $con->recursive = -1;
        foreach ($listado as $aspirante):
            $conyugue = $con->find('first', array('conditions' => array('Candidate.candidate_id' => $aspirante['Candidate']['id']), 'fields' => array('Candidate.1er_nombre', 'Candidate.2do_nombre', 'Candidate.1er_apellido', 'Candidate.2do_apellido')));
            ?>
            <tr>
                <td><?php
        echo $aspirante['Candidate']['1er_nombre'] . " " . $aspirante['Candidate']['2do_nombre'] . " " . $aspirante['Candidate']['1er_apellido'] . " " . $aspirante['Candidate']['2do_apellido'];
        if (!empty($conyugue))
            echo '<br><br>Conyugue ' . $conyugue['Candidate']['1er_nombre'] . " " . $conyugue['Candidate']['2do_nombre'] . " " . $conyugue['Candidate']['1er_apellido'] . " " . $conyugue['Candidate']['2do_apellido'];
            ?></td>
                <td><?php
                if (is_null($aspirante['CandidateMonitoringActivity']['asistio']) OR $aspirante['CandidateMonitoringActivity']['asistio'] == 0) {
                    echo "No";
                } else {
                    echo "Si";
                }
            ?></td>
                <td><?php echo $aspirante['CandidateMonitoringActivity']['observacion'] ?></td>
                <td>
                    <br>
                    <?php echo $this->Ajax->link('Editar', array('controller' => 'CandidateMonitoringActivities', 'action' => 'edit', $aspirante['CandidateMonitoringActivity']['id']), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions')); ?>
                    <br><br> 
                </td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<br><br>
<?php
echo $ajax->link($html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'regresar')), array('controller' => 'MonitoringActivities', 'action' => 'index', $operating_plan_id), array('update' => 'content', 'indicator' => 'loading', 'escape' => false));
?>